use super::*;

pub struct Log {
    finished: bool,
    message: String,
}

impl Log {
    pub fn new(message: &str) -> Box<Self> {
        Box::new(Self {
            finished: false,
            message: String::from(message),
        })
    }
}

impl ITask for Log {
    fn step(&mut self) {
        println!("{}", self.message);
        self.finished = true;
    }

    fn reset(&mut self) {
        self.finished = false;
    }

    fn is_finished(&self) -> bool {
        self.finished
    }
}
